#include <iostream>

using namespace std;

const int N = 1e6 + 10;

int q[N], s[N];
int n;

int main(void)
{
    int l, r, x, m;
    cin >> n >> m;
    for (int i = 1; i <= n; i++)
    {
        scanf("%d", &s[i]);
        q[i] = s[i] - s[i - 1];
    }

    for (int i = 0; i < m; i++)
    {
        scanf("%d%d%d", &l, &r, &x);
        q[l] += x;
        q[r + 1] -= x;
    }

    for (int i = 1; i <= n; i++)
    {
        s[i] = s[i - 1] + q[i];
        cout << s[i] << ' ';
    }
    cout << endl;
}